<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns,CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- Module      : Data.Text.Lazy.Encoding</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Copyright   : (c) 2009, 2010 Bryan O'Sullivan</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- License     : BSD-style</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Maintainer  : bos@serpentine.com</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Portability : portable</span><span>
</span><span id="line-10"></span><span class="hs-comment">--</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Functions for converting lazy 'Text' values to and from lazy</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- 'ByteString', using several standard encodings.</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- To gain access to a much larger family of encodings, use the</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- &lt;http://hackage.haskell.org/package/text-icu text-icu package&gt;.</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Text.Lazy.Encoding</span><span>
</span><span id="line-18"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-19"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Decoding ByteStrings to Text</span></span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><span class="hs-comment">-- $strict</span></span><span>
</span><span id="line-21"></span><span>      </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeASCII"><span class="hs-identifier">decodeASCII</span></a></span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeLatin1"><span class="hs-identifier">decodeLatin1</span></a></span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8"><span class="hs-identifier">decodeUtf8</span></a></span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LE"><span class="hs-identifier">decodeUtf16LE</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BE"><span class="hs-identifier">decodeUtf16BE</span></a></span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LE"><span class="hs-identifier">decodeUtf32LE</span></a></span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BE"><span class="hs-identifier">decodeUtf32BE</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Catchable failure</span></span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8%27"><span class="hs-identifier">decodeUtf8'</span></a></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Controllable error handling</span></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8With"><span class="hs-identifier">decodeUtf8With</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LEWith"><span class="hs-identifier">decodeUtf16LEWith</span></a></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BEWith"><span class="hs-identifier">decodeUtf16BEWith</span></a></span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LEWith"><span class="hs-identifier">decodeUtf32LEWith</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BEWith"><span class="hs-identifier">decodeUtf32BEWith</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Encoding Text to ByteStrings</span></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8"><span class="hs-identifier">encodeUtf8</span></a></span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf16LE"><span class="hs-identifier">encodeUtf16LE</span></a></span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf16BE"><span class="hs-identifier">encodeUtf16BE</span></a></span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf32LE"><span class="hs-identifier">encodeUtf32LE</span></a></span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf32BE"><span class="hs-identifier">encodeUtf32BE</span></a></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Encoding Text using ByteString Builders</span></span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8Builder"><span class="hs-identifier">encodeUtf8Builder</span></a></span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8BuilderEscaped"><span class="hs-identifier">encodeUtf8BuilderEscaped</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#evaluate"><span class="hs-identifier">evaluate</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.Base.html#try"><span class="hs-identifier">try</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier">Monoid</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html"><span class="hs-identifier">Data.Text.Encoding.Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Encoding.Error.html#OnDecodeError"><span class="hs-identifier">OnDecodeError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#UnicodeException"><span class="hs-identifier">UnicodeException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#strictDecode"><span class="hs-identifier">strictDecode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html"><span class="hs-identifier">Data.Text.Internal.Lazy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier">Text</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier">chunk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier">empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier">foldrChunks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.html#"><span class="hs-identifier">Data.ByteString.Builder</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Extra.html#"><span class="hs-identifier">Data.ByteString.Builder.Extra</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#safeStrategy"><span class="hs-identifier">safeStrategy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#toLazyByteStringWith"><span class="hs-identifier">toLazyByteStringWith</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Prim.html#"><span class="hs-identifier">Data.ByteString.Builder.Prim</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BP</span></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.html#"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#"><span class="hs-identifier">Data.ByteString.Lazy.Internal</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.html"><span class="hs-identifier">Data.Text</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">T</span></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Encoding.html"><span class="hs-identifier">Data.Text.Encoding</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TE</span></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Encoding.Fusion.html"><span class="hs-identifier">Data.Text.Internal.Lazy.Encoding.Fusion</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">E</span></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html"><span class="hs-identifier">Data.Text.Internal.Lazy.Fusion</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">F</span></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Unsafe.html"><span class="hs-identifier">Data.Text.Unsafe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier">unsafeDupablePerformIO</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-comment">-- $strict</span><span>
</span><span id="line-69"></span><span class="hs-comment">--</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- All of the single-parameter functions for decoding bytestrings</span><span>
</span><span id="line-71"></span><span class="hs-comment">-- encoded in one of the Unicode Transformation Formats (UTF) operate</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- in a /strict/ mode: each will throw an exception if given invalid</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- input.</span><span>
</span><span id="line-74"></span><span class="hs-comment">--</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- Each function has a variant, whose name is suffixed with -'With',</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- that gives greater control over the handling of decoding errors.</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- For instance, 'decodeUtf8' will throw an exception, but</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- 'decodeUtf8With' allows the programmer to determine what to do on a</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- decoding error.</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">-- | /Deprecated/.  Decode a 'ByteString' containing 7-bit ASCII</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- encoded text.</span><span>
</span><span id="line-83"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeASCII"><span class="hs-identifier hs-type">decodeASCII</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-84"></span><span id="decodeASCII"><span class="annot"><span class="annottext">decodeASCII :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeASCII"><span class="hs-identifier hs-var hs-var">decodeASCII</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8"><span class="hs-identifier hs-var">decodeUtf8</span></a></span><span>
</span><span id="line-85"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">decodeASCII</span><span> </span><span class="hs-pragma">&quot;Use decodeUtf8 instead&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-comment">-- | Decode a 'ByteString' containing Latin-1 (aka ISO-8859-1) encoded text.</span><span>
</span><span id="line-88"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeLatin1"><span class="hs-identifier hs-type">decodeLatin1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-89"></span><span id="decodeLatin1"><span class="annot"><span class="annottext">decodeLatin1 :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeLatin1"><span class="hs-identifier hs-var hs-var">decodeLatin1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Text -&gt; Text) -&gt; Text -&gt; [ByteString] -&gt; Text
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text)
-&gt; (ByteString -&gt; Text) -&gt; ByteString -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Text
</span><a href="Data.Text.Encoding.html#decodeLatin1"><span class="hs-identifier hs-var">TE.decodeLatin1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">([ByteString] -&gt; Text)
-&gt; (ByteString -&gt; [ByteString]) -&gt; ByteString -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString]
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#toChunks"><span class="hs-identifier hs-var">B.toChunks</span></a></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-comment">-- | Decode a 'ByteString' containing UTF-8 encoded text.</span><span>
</span><span id="line-92"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8With"><span class="hs-identifier hs-type">decodeUtf8With</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#OnDecodeError"><span class="hs-identifier hs-type">OnDecodeError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-93"></span><span id="decodeUtf8With"><span class="annot"><span class="annottext">decodeUtf8With :: OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8With"><span class="hs-identifier hs-var hs-var">decodeUtf8With</span></a></span></span><span> </span><span id="local-6989586621679112194"><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112194"><span class="hs-identifier hs-var">onErr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">B.Chunk</span></a></span><span> </span><span id="local-6989586621679112192"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112192"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span id="local-6989586621679112191"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112191"><span class="hs-identifier hs-var">bs0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Decoding
</span><a href="Data.Text.Encoding.html#streamDecodeUtf8With"><span class="hs-identifier hs-var">TE.streamDecodeUtf8With</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112194"><span class="hs-identifier hs-var">onErr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112192"><span class="hs-identifier hs-var">b0</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-95"></span><span>      </span><span class="annot"><a href="Data.Text.Encoding.html#Some"><span class="hs-identifier hs-type">TE.Some</span></a></span><span> </span><span id="local-6989586621679112188"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112188"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112187"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112187"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679112186"><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><a href="#local-6989586621679112186"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112188"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ByteString -&gt; Decoding) -&gt; ByteString -&gt; ByteString -&gt; Text
</span><a href="#local-6989586621679112185"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><a href="#local-6989586621679112186"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112187"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112191"><span class="hs-identifier hs-var">bs0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-97"></span><span>    </span><span id="local-6989586621679112185"><span class="annot"><span class="annottext">go :: (ByteString -&gt; Decoding) -&gt; ByteString -&gt; ByteString -&gt; Text
</span><a href="#local-6989586621679112185"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112184"><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><a href="#local-6989586621679112184"><span class="hs-identifier hs-var">f0</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#Chunk"><span class="hs-identifier hs-type">B.Chunk</span></a></span><span> </span><span id="local-6989586621679112183"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112183"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679112182"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112182"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-98"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><a href="#local-6989586621679112184"><span class="hs-identifier hs-var">f0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112183"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><a href="Data.Text.Encoding.html#Some"><span class="hs-identifier hs-type">TE.Some</span></a></span><span> </span><span id="local-6989586621679112181"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112181"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112180"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112180"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679112179"><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><a href="#local-6989586621679112179"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112181"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ByteString -&gt; Decoding) -&gt; ByteString -&gt; ByteString -&gt; Text
</span><a href="#local-6989586621679112185"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><a href="#local-6989586621679112179"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112180"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112182"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><a href="#local-6989586621679112185"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoding
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679112178"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112178"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-101"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">S.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112178"><span class="hs-identifier hs-var">l</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-102"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-103"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679112176"><span class="annot"><span class="annottext">t :: Text
</span><a href="#local-6989586621679112176"><span class="hs-identifier hs-var hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
</span><a href="Data.Text.html#pack"><span class="hs-identifier hs-var">T.pack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; String
</span><a href="#local-6989586621679112174"><span class="hs-identifier hs-var">skipBytes</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112178"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span>            </span><span id="local-6989586621679112174"><span class="annot"><span class="annottext">skipBytes :: ByteString -&gt; String
</span><a href="#local-6989586621679112174"><span class="hs-identifier hs-var hs-var">skipBytes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; String -&gt; String) -&gt; String -&gt; ByteString -&gt; String
forall a. (Word8 -&gt; a -&gt; a) -&gt; a -&gt; ByteString -&gt; a
</span><a href="../../bytestring/src/Data.ByteString.html#foldr"><span class="hs-identifier hs-var">S.foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679112172"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679112172"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679112171"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112171"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-105"></span><span>                  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112194"><span class="hs-identifier hs-var">onErr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112170"><span class="hs-identifier hs-var">desc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Maybe Word8
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679112172"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-106"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679112169"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112169"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112169"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112171"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-107"></span><span>                    </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112171"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112176"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-109"></span><span>    </span><span id="local-6989586621679112170"><span class="annot"><span class="annottext">desc :: String
</span><a href="#local-6989586621679112170"><span class="hs-identifier hs-var hs-var">desc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Text.Lazy.Encoding.decodeUtf8With: Invalid UTF-8 stream&quot;</span></span><span>
</span><span id="line-110"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8With"><span class="hs-identifier hs-var">decodeUtf8With</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- | Decode a 'ByteString' containing UTF-8 encoded text that is known</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- to be valid.</span><span>
</span><span id="line-114"></span><span class="hs-comment">--</span><span>
</span><span id="line-115"></span><span class="hs-comment">-- If the input contains any invalid UTF-8 data, an exception will be</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- thrown that cannot be caught in pure code.  For more control over</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- the handling of invalid data, use 'decodeUtf8'' or</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- 'decodeUtf8With'.</span><span>
</span><span id="line-119"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8"><span class="hs-identifier hs-type">decodeUtf8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-120"></span><span id="decodeUtf8"><span class="annot"><span class="annottext">decodeUtf8 :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8"><span class="hs-identifier hs-var hs-var">decodeUtf8</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8With"><span class="hs-identifier hs-var">decodeUtf8With</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="Data.Text.Encoding.Error.html#strictDecode"><span class="hs-identifier hs-var">strictDecode</span></a></span><span>
</span><span id="line-121"></span><span class="hs-pragma">{-# INLINE</span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8"><span class="hs-pragma hs-type">decodeUtf8</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-comment">-- This rule seems to cause performance loss.</span><span>
</span><span id="line-124"></span><span class="hs-comment">{- RULES &quot;LAZY STREAM stream/decodeUtf8' fusion&quot; [1]
   forall bs. F.stream (decodeUtf8' bs) = E.streamUtf8 strictDecode bs #-}</span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- | Decode a 'ByteString' containing UTF-8 encoded text..</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- If the input contains any invalid UTF-8 data, the relevant</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- exception will be returned, otherwise the decoded text.</span><span>
</span><span id="line-131"></span><span class="hs-comment">--</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- /Note/: this function is /not/ lazy, as it must decode its entire</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- input before it can return a result.  If you need lazy (streaming)</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- decoding, use 'decodeUtf8With' in lenient mode.</span><span>
</span><span id="line-135"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8%27"><span class="hs-identifier hs-type">decodeUtf8'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#UnicodeException"><span class="hs-identifier hs-type">UnicodeException</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-136"></span><span id="decodeUtf8%27"><span class="annot"><span class="annottext">decodeUtf8' :: ByteString -&gt; Either UnicodeException Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8%27"><span class="hs-identifier hs-var hs-var">decodeUtf8'</span></a></span></span><span> </span><span id="local-6989586621679112166"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112166"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (Either UnicodeException Text) -&gt; Either UnicodeException Text
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Either UnicodeException Text) -&gt; Either UnicodeException Text)
-&gt; IO (Either UnicodeException Text)
-&gt; Either UnicodeException Text
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-137"></span><span>                   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112165"><span class="annot"><span class="annottext">t :: Text
</span><a href="#local-6989586621679112165"><span class="hs-identifier hs-var hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8"><span class="hs-identifier hs-var">decodeUtf8</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112166"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-138"></span><span>                   </span><span class="annot"><span class="annottext">IO Text -&gt; IO (Either UnicodeException Text)
forall e a. Exception e =&gt; IO a -&gt; IO (Either e a)
</span><a href="../../base/src/Control.Exception.Base.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; IO Text
forall a. a -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#evaluate"><span class="hs-identifier hs-var">evaluate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; ()
</span><a href="#local-6989586621679112164"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112165"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; Text -&gt; Text
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112165"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-140"></span><span>    </span><span id="local-6989586621679112164"><span class="annot"><span class="annottext">rnf :: Text -&gt; ()
</span><a href="#local-6989586621679112164"><span class="hs-identifier hs-var hs-var">rnf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>    </span><span class="annot"><a href="#local-6989586621679112164"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679112163"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112163"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; ()
</span><a href="#local-6989586621679112164"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112163"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-142"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8%27"><span class="hs-pragma hs-type">decodeUtf8'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-comment">-- | Encode text using UTF-8 encoding.</span><span>
</span><span id="line-145"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8"><span class="hs-identifier hs-type">encodeUtf8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-146"></span><span id="encodeUtf8"><span class="annot"><span class="annottext">encodeUtf8 :: Text -&gt; ByteString
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf8"><span class="hs-identifier hs-var hs-var">encodeUtf8</span></a></span></span><span>    </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span>
</span><span id="line-147"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8"><span class="hs-identifier hs-var">encodeUtf8</span></a></span><span> </span><span id="local-6989586621679112161"><span class="annot"><span class="annottext">lt :: Text
</span><a href="#local-6989586621679112161"><span class="hs-identifier hs-var">lt</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112160"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112160"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-148"></span><span>    </span><span class="annot"><span class="annottext">AllocationStrategy -&gt; ByteString -&gt; Builder -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#toLazyByteStringWith"><span class="hs-identifier hs-var">B.toLazyByteStringWith</span></a></span><span> </span><span class="annot"><span class="annottext">AllocationStrategy
</span><a href="#local-6989586621679112159"><span class="hs-identifier hs-var">strategy</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span> </span><span class="annot"><span class="annottext">(Builder -&gt; ByteString) -&gt; Builder -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Builder
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf8Builder"><span class="hs-identifier hs-var">encodeUtf8Builder</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112161"><span class="hs-identifier hs-var">lt</span></a></span><span>
</span><span id="line-149"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-150"></span><span>    </span><span class="hs-comment">-- To improve our small string performance, we use a strategy that</span><span>
</span><span id="line-151"></span><span>    </span><span class="hs-comment">-- allocates a buffer that is guaranteed to be large enough for the</span><span>
</span><span id="line-152"></span><span>    </span><span class="hs-comment">-- encoding of the first chunk, but not larger than the default</span><span>
</span><span id="line-153"></span><span>    </span><span class="hs-comment">-- B.smallChunkSize. We clamp the firstChunkSize to ensure that we don't</span><span>
</span><span id="line-154"></span><span>    </span><span class="hs-comment">-- generate too large buffers which hamper streaming.</span><span>
</span><span id="line-155"></span><span>    </span><span id="local-6989586621679112151"><span class="annot"><span class="annottext">firstChunkSize :: Int
</span><a href="#local-6989586621679112151"><span class="hs-identifier hs-var hs-var">firstChunkSize</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><a href="../../ghc-prim/src/GHC.Classes.html#min"><span class="hs-identifier hs-var">min</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#smallChunkSize"><span class="hs-identifier hs-var">B.smallChunkSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112160"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>    </span><span id="local-6989586621679112159"><span class="annot"><span class="annottext">strategy :: AllocationStrategy
</span><a href="#local-6989586621679112159"><span class="hs-identifier hs-var hs-var">strategy</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; AllocationStrategy
</span><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#safeStrategy"><span class="hs-identifier hs-var">B.safeStrategy</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112151"><span class="hs-identifier hs-var">firstChunkSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#defaultChunkSize"><span class="hs-identifier hs-var">B.defaultChunkSize</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- | Encode text to a ByteString 'B.Builder' using UTF-8 encoding.</span><span>
</span><span id="line-159"></span><span class="hs-comment">--</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- @since 1.1.0.0</span><span>
</span><span id="line-161"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8Builder"><span class="hs-identifier hs-type">encodeUtf8Builder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">B.Builder</span></a></span><span>
</span><span id="line-162"></span><span id="encodeUtf8Builder"><span class="annot"><span class="annottext">encodeUtf8Builder :: Text -&gt; Builder
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf8Builder"><span class="hs-identifier hs-var hs-var">encodeUtf8Builder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-163"></span><span>    </span><span class="annot"><span class="annottext">(Text -&gt; Builder -&gt; Builder) -&gt; Builder -&gt; Text -&gt; Builder
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679112144"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112144"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112143"><span class="annot"><span class="annottext">Builder
</span><a href="#local-6989586621679112143"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Builder
</span><a href="Data.Text.Encoding.html#encodeUtf8Builder"><span class="hs-identifier hs-var">TE.encodeUtf8Builder</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112144"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Builder -&gt; Builder -&gt; Builder
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">Builder
</span><a href="#local-6989586621679112143"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Builder
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">Data.Monoid.mempty</span></a></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">-- | Encode text using UTF-8 encoding and escape the ASCII characters using</span><span>
</span><span id="line-166"></span><span class="hs-comment">-- a 'BP.BoundedPrim'.</span><span>
</span><span id="line-167"></span><span class="hs-comment">--</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- Use this function is to implement efficient encoders for text-based formats</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- like JSON or HTML.</span><span>
</span><span id="line-170"></span><span class="hs-comment">--</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- @since 1.1.0.0</span><span>
</span><span id="line-172"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8BuilderEscaped"><span class="hs-pragma hs-type">encodeUtf8BuilderEscaped</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-173"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8BuilderEscaped"><span class="hs-identifier hs-type">encodeUtf8BuilderEscaped</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Prim.Internal.html#BoundedPrim"><span class="hs-identifier hs-type">BP.BoundedPrim</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Builder.Internal.html#Builder"><span class="hs-identifier hs-type">B.Builder</span></a></span><span>
</span><span id="line-174"></span><span id="encodeUtf8BuilderEscaped"><span class="annot"><span class="annottext">encodeUtf8BuilderEscaped :: BoundedPrim Word8 -&gt; Text -&gt; Builder
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf8BuilderEscaped"><span class="hs-identifier hs-var hs-var">encodeUtf8BuilderEscaped</span></a></span></span><span> </span><span id="local-6989586621679112141"><span class="annot"><span class="annottext">BoundedPrim Word8
</span><a href="#local-6989586621679112141"><span class="hs-keyword hs-var">prim</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-175"></span><span>    </span><span class="annot"><span class="annottext">(Text -&gt; Builder -&gt; Builder) -&gt; Builder -&gt; Text -&gt; Builder
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679112140"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112140"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112139"><span class="annot"><span class="annottext">Builder
</span><a href="#local-6989586621679112139"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BoundedPrim Word8 -&gt; Text -&gt; Builder
</span><a href="Data.Text.Encoding.html#encodeUtf8BuilderEscaped"><span class="hs-identifier hs-var">TE.encodeUtf8BuilderEscaped</span></a></span><span> </span><span class="annot"><span class="annottext">BoundedPrim Word8
</span><a href="#local-6989586621679112141"><span class="hs-keyword hs-var">prim</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112140"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Builder -&gt; Builder -&gt; Builder
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">Builder
</span><a href="#local-6989586621679112139"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Builder
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | Decode text from little endian UTF-16 encoding.</span><span>
</span><span id="line-178"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LEWith"><span class="hs-identifier hs-type">decodeUtf16LEWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#OnDecodeError"><span class="hs-identifier hs-type">OnDecodeError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-179"></span><span id="decodeUtf16LEWith"><span class="annot"><span class="annottext">decodeUtf16LEWith :: OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LEWith"><span class="hs-identifier hs-var hs-var">decodeUtf16LEWith</span></a></span></span><span> </span><span id="local-6989586621679112137"><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112137"><span class="hs-identifier hs-var">onErr</span></a></span></span><span> </span><span id="local-6989586621679112136"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112136"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">F.unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Encoding.Fusion.html#streamUtf16LE"><span class="hs-identifier hs-var">E.streamUtf16LE</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112137"><span class="hs-identifier hs-var">onErr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112136"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LEWith"><span class="hs-pragma hs-type">decodeUtf16LEWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="hs-comment">-- | Decode text from little endian UTF-16 encoding.</span><span>
</span><span id="line-183"></span><span class="hs-comment">--</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- If the input contains any invalid little endian UTF-16 data, an</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- exception will be thrown.  For more control over the handling of</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- invalid data, use 'decodeUtf16LEWith'.</span><span>
</span><span id="line-187"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LE"><span class="hs-identifier hs-type">decodeUtf16LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-188"></span><span id="decodeUtf16LE"><span class="annot"><span class="annottext">decodeUtf16LE :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LE"><span class="hs-identifier hs-var hs-var">decodeUtf16LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LEWith"><span class="hs-identifier hs-var">decodeUtf16LEWith</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="Data.Text.Encoding.Error.html#strictDecode"><span class="hs-identifier hs-var">strictDecode</span></a></span><span>
</span><span id="line-189"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16LE"><span class="hs-pragma hs-type">decodeUtf16LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span class="hs-comment">-- | Decode text from big endian UTF-16 encoding.</span><span>
</span><span id="line-192"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BEWith"><span class="hs-identifier hs-type">decodeUtf16BEWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#OnDecodeError"><span class="hs-identifier hs-type">OnDecodeError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-193"></span><span id="decodeUtf16BEWith"><span class="annot"><span class="annottext">decodeUtf16BEWith :: OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BEWith"><span class="hs-identifier hs-var hs-var">decodeUtf16BEWith</span></a></span></span><span> </span><span id="local-6989586621679112133"><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112133"><span class="hs-identifier hs-var">onErr</span></a></span></span><span> </span><span id="local-6989586621679112132"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112132"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">F.unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Encoding.Fusion.html#streamUtf16BE"><span class="hs-identifier hs-var">E.streamUtf16BE</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112133"><span class="hs-identifier hs-var">onErr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112132"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BEWith"><span class="hs-pragma hs-type">decodeUtf16BEWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-comment">-- | Decode text from big endian UTF-16 encoding.</span><span>
</span><span id="line-197"></span><span class="hs-comment">--</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- If the input contains any invalid big endian UTF-16 data, an</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- exception will be thrown.  For more control over the handling of</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- invalid data, use 'decodeUtf16BEWith'.</span><span>
</span><span id="line-201"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BE"><span class="hs-identifier hs-type">decodeUtf16BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-202"></span><span id="decodeUtf16BE"><span class="annot"><span class="annottext">decodeUtf16BE :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BE"><span class="hs-identifier hs-var hs-var">decodeUtf16BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BEWith"><span class="hs-identifier hs-var">decodeUtf16BEWith</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="Data.Text.Encoding.Error.html#strictDecode"><span class="hs-identifier hs-var">strictDecode</span></a></span><span>
</span><span id="line-203"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf16BE"><span class="hs-pragma hs-type">decodeUtf16BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="hs-comment">-- | Encode text using little endian UTF-16 encoding.</span><span>
</span><span id="line-206"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf16LE"><span class="hs-identifier hs-type">encodeUtf16LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-207"></span><span id="encodeUtf16LE"><span class="annot"><span class="annottext">encodeUtf16LE :: Text -&gt; ByteString
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf16LE"><span class="hs-identifier hs-var hs-var">encodeUtf16LE</span></a></span></span><span> </span><span id="local-6989586621679112130"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112130"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier hs-var">B.fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Text -&gt; [ByteString] -&gt; [ByteString])
-&gt; [ByteString] -&gt; Text -&gt; [ByteString]
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [ByteString] -&gt; [ByteString])
-&gt; (Text -&gt; ByteString) -&gt; Text -&gt; [ByteString] -&gt; [ByteString]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; ByteString
</span><a href="Data.Text.Encoding.html#encodeUtf16LE"><span class="hs-identifier hs-var">TE.encodeUtf16LE</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112130"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf16LE"><span class="hs-pragma hs-type">encodeUtf16LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- | Encode text using big endian UTF-16 encoding.</span><span>
</span><span id="line-211"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf16BE"><span class="hs-identifier hs-type">encodeUtf16BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-212"></span><span id="encodeUtf16BE"><span class="annot"><span class="annottext">encodeUtf16BE :: Text -&gt; ByteString
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf16BE"><span class="hs-identifier hs-var hs-var">encodeUtf16BE</span></a></span></span><span> </span><span id="local-6989586621679112127"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112127"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier hs-var">B.fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Text -&gt; [ByteString] -&gt; [ByteString])
-&gt; [ByteString] -&gt; Text -&gt; [ByteString]
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [ByteString] -&gt; [ByteString])
-&gt; (Text -&gt; ByteString) -&gt; Text -&gt; [ByteString] -&gt; [ByteString]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; ByteString
</span><a href="Data.Text.Encoding.html#encodeUtf16BE"><span class="hs-identifier hs-var">TE.encodeUtf16BE</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112127"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-213"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf16BE"><span class="hs-pragma hs-type">encodeUtf16BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-comment">-- | Decode text from little endian UTF-32 encoding.</span><span>
</span><span id="line-216"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LEWith"><span class="hs-identifier hs-type">decodeUtf32LEWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#OnDecodeError"><span class="hs-identifier hs-type">OnDecodeError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-217"></span><span id="decodeUtf32LEWith"><span class="annot"><span class="annottext">decodeUtf32LEWith :: OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LEWith"><span class="hs-identifier hs-var hs-var">decodeUtf32LEWith</span></a></span></span><span> </span><span id="local-6989586621679112125"><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112125"><span class="hs-identifier hs-var">onErr</span></a></span></span><span> </span><span id="local-6989586621679112124"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112124"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">F.unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Encoding.Fusion.html#streamUtf32LE"><span class="hs-identifier hs-var">E.streamUtf32LE</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112125"><span class="hs-identifier hs-var">onErr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112124"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LEWith"><span class="hs-pragma hs-type">decodeUtf32LEWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span class="hs-comment">-- | Decode text from little endian UTF-32 encoding.</span><span>
</span><span id="line-221"></span><span class="hs-comment">--</span><span>
</span><span id="line-222"></span><span class="hs-comment">-- If the input contains any invalid little endian UTF-32 data, an</span><span>
</span><span id="line-223"></span><span class="hs-comment">-- exception will be thrown.  For more control over the handling of</span><span>
</span><span id="line-224"></span><span class="hs-comment">-- invalid data, use 'decodeUtf32LEWith'.</span><span>
</span><span id="line-225"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LE"><span class="hs-identifier hs-type">decodeUtf32LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-226"></span><span id="decodeUtf32LE"><span class="annot"><span class="annottext">decodeUtf32LE :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LE"><span class="hs-identifier hs-var hs-var">decodeUtf32LE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LEWith"><span class="hs-identifier hs-var">decodeUtf32LEWith</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="Data.Text.Encoding.Error.html#strictDecode"><span class="hs-identifier hs-var">strictDecode</span></a></span><span>
</span><span id="line-227"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32LE"><span class="hs-pragma hs-type">decodeUtf32LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="hs-comment">-- | Decode text from big endian UTF-32 encoding.</span><span>
</span><span id="line-230"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BEWith"><span class="hs-identifier hs-type">decodeUtf32BEWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Encoding.Error.html#OnDecodeError"><span class="hs-identifier hs-type">OnDecodeError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-231"></span><span id="decodeUtf32BEWith"><span class="annot"><span class="annottext">decodeUtf32BEWith :: OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BEWith"><span class="hs-identifier hs-var hs-var">decodeUtf32BEWith</span></a></span></span><span> </span><span id="local-6989586621679112122"><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112122"><span class="hs-identifier hs-var">onErr</span></a></span></span><span> </span><span id="local-6989586621679112121"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112121"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">F.unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Encoding.Fusion.html#streamUtf32BE"><span class="hs-identifier hs-var">E.streamUtf32BE</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="#local-6989586621679112122"><span class="hs-identifier hs-var">onErr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112121"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BEWith"><span class="hs-pragma hs-type">decodeUtf32BEWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="hs-comment">-- | Decode text from big endian UTF-32 encoding.</span><span>
</span><span id="line-235"></span><span class="hs-comment">--</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- If the input contains any invalid big endian UTF-32 data, an</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- exception will be thrown.  For more control over the handling of</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- invalid data, use 'decodeUtf32BEWith'.</span><span>
</span><span id="line-239"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BE"><span class="hs-identifier hs-type">decodeUtf32BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-240"></span><span id="decodeUtf32BE"><span class="annot"><span class="annottext">decodeUtf32BE :: ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BE"><span class="hs-identifier hs-var hs-var">decodeUtf32BE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OnDecodeError -&gt; ByteString -&gt; Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BEWith"><span class="hs-identifier hs-var">decodeUtf32BEWith</span></a></span><span> </span><span class="annot"><span class="annottext">OnDecodeError
</span><a href="Data.Text.Encoding.Error.html#strictDecode"><span class="hs-identifier hs-var">strictDecode</span></a></span><span>
</span><span id="line-241"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf32BE"><span class="hs-pragma hs-type">decodeUtf32BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-comment">-- | Encode text using little endian UTF-32 encoding.</span><span>
</span><span id="line-244"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf32LE"><span class="hs-identifier hs-type">encodeUtf32LE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-245"></span><span id="encodeUtf32LE"><span class="annot"><span class="annottext">encodeUtf32LE :: Text -&gt; ByteString
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf32LE"><span class="hs-identifier hs-var hs-var">encodeUtf32LE</span></a></span></span><span> </span><span id="local-6989586621679112119"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112119"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier hs-var">B.fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Text -&gt; [ByteString] -&gt; [ByteString])
-&gt; [ByteString] -&gt; Text -&gt; [ByteString]
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [ByteString] -&gt; [ByteString])
-&gt; (Text -&gt; ByteString) -&gt; Text -&gt; [ByteString] -&gt; [ByteString]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; ByteString
</span><a href="Data.Text.Encoding.html#encodeUtf32LE"><span class="hs-identifier hs-var">TE.encodeUtf32LE</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112119"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf32LE"><span class="hs-pragma hs-type">encodeUtf32LE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="hs-comment">-- | Encode text using big endian UTF-32 encoding.</span><span>
</span><span id="line-249"></span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf32BE"><span class="hs-identifier hs-type">encodeUtf32BE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-250"></span><span id="encodeUtf32BE"><span class="annot"><span class="annottext">encodeUtf32BE :: Text -&gt; ByteString
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf32BE"><span class="hs-identifier hs-var hs-var">encodeUtf32BE</span></a></span></span><span> </span><span id="local-6989586621679112117"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112117"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier hs-var">B.fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Text -&gt; [ByteString] -&gt; [ByteString])
-&gt; [ByteString] -&gt; Text -&gt; [ByteString]
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [ByteString] -&gt; [ByteString])
-&gt; (Text -&gt; ByteString) -&gt; Text -&gt; [ByteString] -&gt; [ByteString]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; ByteString
</span><a href="Data.Text.Encoding.html#encodeUtf32BE"><span class="hs-identifier hs-var">TE.encodeUtf32BE</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112117"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf32BE"><span class="hs-pragma hs-type">encodeUtf32BE</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-252"></span></pre></body></html>